# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: 3ED <krzysztof1987 at gmail dot com>

pkgname=perl-cairo-gobject
_perl_namespace=Cairo
_perl_module=GObject
pkgver=1.005
pkgrel=1
pkgdesc="Integrate Cairo into the Glib type system"
arch=('loong64' 'x86_64')
url="https://metacpan.org/dist/${_perl_namespace}-${_perl_module}"
license=('LGPL')
makedepends=('perl-extutils-depends' 'perl-extutils-pkgconfig')
depends=('glib-perl' 'cairo-perl')
source=("https://cpan.metacpan.org/authors/id/X/XA/XAOC/${_perl_namespace}-${_perl_module}-${pkgver}.tar.gz")
sha256sums=('8d896444d71e1d0bca3d24e31e5d82bd0d9542aaed91d1fb7eab367bce675c50')
options=('!emptydirs')

build() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

check() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  make pure_install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
